package com.boang.list;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;

/*
    @author:sa
    @date:2024/11/28 15:15
*/
public class LinkedListDemo {
    public static void main(String[] args) {
        LinkedList linkedList = new LinkedList();
        linkedList.add("b");
        linkedList.add("a");
        linkedList.addLast("c");
        linkedList.addFirst("d");
        System.out.println(linkedList.getFirst());
        System.out.println(linkedList.getLast());
        System.out.println(linkedList.peekFirst());
        System.out.println(linkedList.pollFirst());
        System.out.println(linkedList);
    }
}